package com.member.model;

import javax.servlet.*;
import javax.servlet.http.*;

import com.carorderdetail.model.CarOrderDetailDAO;

import java.io.*;


public class MemberServletChangeStatusAndroid extends HttpServlet {
    public void doGet(HttpServletRequest rq, HttpServletResponse rp) 
    				throws ServletException, IOException{
		String order_id = rq.getParameter("order_id");
		String member_id = rq.getParameter("member_id");
		String driver_scores=rq.getParameter("driver_scores");
		System.out.print(driver_scores);
		if (order_id==null || member_id==null || driver_scores==null){
			
		}else{
    	CarOrderDetailDAO carorderdetailDAO =new CarOrderDetailDAO();
    	carorderdetailDAO.updateStatus(order_id, member_id);
    	carorderdetailDAO.add_driver_scores(order_id, member_id, driver_scores);
    	  rp.setContentType("text/html; charset=utf-8");
          PrintWriter out = rp.getWriter();
          out.close();
		}
  
    }
    
    public void doPost(HttpServletRequest rq, HttpServletResponse rp) 
    				throws ServletException, IOException{
		String order_id = rq.getParameter("order_id");
		String member_id = rq.getParameter("member_id");
		String driver_scores=rq.getParameter("driver_scores");
		System.out.print(driver_scores);
		if (order_id==null || member_id==null || driver_scores==null){
			
		}else{
    	CarOrderDetailDAO carorderdetailDAO =new CarOrderDetailDAO();
    	carorderdetailDAO.updateStatus(order_id, member_id);
    	carorderdetailDAO.add_driver_scores(order_id, member_id, driver_scores);
    	  rp.setContentType("text/html; charset=utf-8");
          PrintWriter out = rp.getWriter();
          out.close();
		}
        
        
    }
}